#pragma once
#include <iostream>
#include <vector>
#include "User.h"
#include "Admin.h"
#include "MeetingRoom.h"
#include "Constant.h"

class User;
class Admin;
class MeetingRoom;

class DataCenter
{
private:
    std::vector<User> users;
    std::vector<Admin> admins;
    std::vector<MeetingRoom> rooms;
    DataCenter();
    static DataCenter dataCenter;

public:
    static DataCenter &getInstance();
    bool addUser(std::string username, std::string password, std::string department);
    bool deleteUser(std::string username);
    std::vector<User> getUsers();

    bool addMeetingRoom(int id, int capacity);
    bool deleteMeetingRoom(int id);
    std::vector<MeetingRoom> getMeetingRooms();
    void clearAllMeetingRoomStatus();

    int bookMeetingRoom(User &user, int id);
    int cancelMeetingRoom(const User &user, int id);
    std::vector<MeetingRoom> bookedMeetingRooms(const User &user);

    User &loginUser(std::string username, std::string password);
    Admin &loginAdmin(std::string username, std::string password);
};